<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Requests\Demo\DemoAddRequest;
use App\Library\Requests\Demo\DemoEditRequest;
use App\Library\Requests\Demo\DemoPageRequest;
use App\Library\Service\DemoService;
use Illuminate\Http\JsonResponse;

class DemoController extends BaseController
{
    /**
     * @param DemoService $service
     */
    public function __construct(DemoService $service)
    {
        $this->service = $service;
    }

    /**
     * paging
     * @param DemoPageRequest $request
     * @return JsonResponse
     */
    public function paging(DemoPageRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     * add
     * @param DemoAddRequest $request
     * @return JsonResponse
     */
    public function add(DemoAddRequest $request): JsonResponse
    {
        return $this->service->add($request);
    }

    /**
     * edit
     * @param DemoEditRequest $request
     * @return JsonResponse
     */
    public function edit(DemoEditRequest $request): JsonResponse
    {
        return $this->service->edit($request);
    }

    /**
     * detail
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function detail(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->detail($request);
    }

    /**
     * delete
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function delete(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->delete($request);
    }
}
